# coding: utf-8
from . import db, BaseModel


class SsoUser(db.Model):
    __tablename__ = 'sso_user'

    auto_id = db.Column(db.BigInteger, primary_key=True, info='自增id')
    user_id = db.Column(db.String(20, 'utf8mb4_general_ci'), nullable=False, info='用户id')
    account = db.Column(db.String(50, 'utf8mb4_general_ci'), nullable=False, info='账号')
    password = db.Column(db.String(500, 'utf8mb4_0900_ai_ci'), nullable=False, server_default=db.FetchedValue(), info='密码')
    login_type = db.Column(db.String(10, 'utf8mb4_general_ci'), nullable=False, info='账号类型\r\n1.邮箱\r\n2.平台账号\r\n3.手机号')
    user_type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='1-咨询者 2-咨询师')
    open_id = db.Column(db.String(50, 'utf8mb4_general_ci'), info='微信登录的open_id')
    headpic_url = db.Column(db.String(200, 'utf8mb3_general_ci'), info='头像URL')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='账号状态 0- 有效 1-冻结')
    is_delete = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='逻辑删除')
    create_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='创建时间')
    update_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='更新时间')
